Skip to content

Conversation

@halter73
Copy link
Contributor

The logging from https://github.com/modelcontextprotocol/csharp-sdk/actions/runs/14040589658/job/39309497411 indicates that one source of test flakiness is a real product issue.

_sseWriteTask might not be set until after the SSE endpoint event has already been sent since SseFormatter.WriteAsync does not return a task until it awaits. This means that it's possible for the client to find the "/message" endpoint and send a message to that before IsConnected is true which can lead to an improper InvalidOperationException as seen in the logs.

@halter73 halter73 requested a review from stephentoub March 25, 2025 00:43
@stephentoub stephentoub merged commit 367f265 into modelcontextprotocol:main Mar 25, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants